﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Acme
{
    public partial class MouseView : UserControl, IMouseView
    {
        public event EventHandler RequestToFeedRodent;

        public MouseView()
        {
            InitializeComponent();
        }

        public void DisableFeeding()
        {
            this.FeedButton.Enabled = false;
        }

        public void UpdateView(IMouseModel pModel)
        {
            this.nameLabel1.Text = pModel.Name;
            this.hairColorLabel1.Text = pModel.HairColor;
            this.maxFeedLabel1.Text = pModel.MaxFeed.ToString();
            this.totalFoodEatenLabel1.Text = pModel.TotalFoodEaten.ToString();
            this.statusLabel1.Text = pModel.Status;
        }

        public int GetAmountToFeedRodent()
        {
            return 1;
        }

        private void FeedButton_Click(object sender, EventArgs e)
        {
            if (RequestToFeedRodent != null)
            { RequestToFeedRodent(this, e); }
        }

    }
}
